package org.xdq.demo.api;

import org.springframework.web.bind.annotation.*;
import org.xdq.demo.dto.MyDto;
import org.xdq.demo.dto.UserDto;

@RestController//等同于@Controller + @ResponseBody
public class TestController2 {

    @GetMapping("/t1") //仅能接收get请求
    public String t1(int a,String b){

        return "a="+a+",b="+b;

    }

    @PostMapping("/t2")//????????
    public String t2( int a,String b){

        return "a="+a+",b="+b;

    }

    @RequestMapping("/t3/{num}/{info}")
    public String t3(@PathVariable String num ,@PathVariable String info){

        return "num="+num+",info="+info;
    }

    @PostMapping("/t8")
    public String t8(@RequestBody  UserDto dto){

        return dto.getU_id()+","+dto.getU_pwd();
    }

}
